<template>
  <div class="user1-page">
    <div class="search-params f-r a-c j-b">
      <el-form inline>
        <el-form-item label="事项名称：">
          <el-input clearable v-model="searchParams.implementUnit" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" round @click="onSearch">筛选</el-button>
          <el-button round @click="onReset">重置</el-button>
        </el-form-item>
      </el-form>

      <el-form>
        <el-form-item>
          <el-button type="primary" round @click="onDownload">批量下载</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="table-box">
      <el-table
        v-loading="loading"
        stripe
        :data="tableData"
        element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(255, 255, 255, 0.8)"
        @selection-change="onSelect"
      >
        <el-table-column type="selection" width="80px" align="center" />
        <el-table-column type="index" width="80px" label="序号" align="center" />
        <el-table-column v-for="item in columns" :key="item.prop" :prop="item.prop" :label="item.label" align="center" />
        <el-table-column label="操作" fixed="right" width="120px">
          <template slot-scope="scope">
            <el-button type="text" @click="onEdit(scope.row)">编辑</el-button>
            <el-button type="text" @click="onDownload(scope.row)">下载</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import crud from '@/mixins/crud'
import { http_project1 } from '@/api'
export default {
  name: 'Index',
  mixins: [crud],
  props: {
    currentDetail: Object
  },
  data() {
    return {
      searchParams: {
      },
      columns: [
        { prop: 'materialItems', label: '事项名称' },
        { prop: 'enclosureName', label: '附件名称' },
        { prop: 'updateTime', label: '修改日期' }
      ],
      tableData: []
    }
  },
  created() {
    this.tableData = this.currentDetail.materialsVos || []
  },
  methods: {
    onDownload() {},
    onAdd() {
      this.$refs.ItemAddRef.open()
    },
    onEdit(item) {
      this.$refs.ItemAddRef.open(item)
    },
    onRead(item) {
      this.$refs.ItemDetailRef.open(item)
    }
  }
}
</script>

<style scoped lang="scss">
</style>
